org.eclipse.vtp.framework.common.support
Class CustomDataType

java.lang.Object
  extended by org.eclipse.vtp.framework.common.support.CustomDataType
All Implemented Interfaces:
IDataType

public class CustomDataType
extends java.lang.Object
implements IDataType

CustomDataType.

Author:
Lonnie Pryor

Constructor Summary
CustomDataType(java.lang.String name, java.lang.String primaryFieldName, CustomDataField[] fields)
          Creates a new CustomDataType.
 
Method Summary
 java.lang.String getFieldInitialValue(java.lang.String fieldName)
          Returns the initial value for new instances of the specified field.
 java.lang.String[] getFieldNames()
          Returns the names of the fields that objects of this type support.
 IDataType getFieldType(java.lang.String fieldName)
          Returns the type of the specified field or null if no such field exists.
 java.lang.String getName()
          Returns the unique name of this type.
 java.lang.String getPrimaryFieldName()
          Returns the name of the field that objects of this type treat as their primary value or null if no such field is defined.
 boolean isArrayType()
          Returns true if this type represents an array type.
 boolean isComplexType()
          Returns true if this type represents a type with named fields.
 boolean isSimpleType()
          Returns true if this type represents a boolean, date, decimal, number, or string type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomDataType

public CustomDataType(java.lang.String name,
                      java.lang.String primaryFieldName,
                      CustomDataField[] fields)
Creates a new CustomDataType.

Parameters:
name -
Method Detail

getName

public java.lang.String getName()
Description copied from interface: IDataType
Returns the unique name of this type.

Specified by:
getName in interface IDataType
Returns:
The unique name of this type.

getPrimaryFieldName

public java.lang.String getPrimaryFieldName()
Description copied from interface: IDataType
Returns the name of the field that objects of this type treat as their primary value or null if no such field is defined.

Specified by:
getPrimaryFieldName in interface IDataType
Returns:
The name of the field that objects of this type treat as their primary value if no such field is defined.

getFieldNames

public java.lang.String[] getFieldNames()
Description copied from interface: IDataType
Returns the names of the fields that objects of this type support.

Specified by:
getFieldNames in interface IDataType
Returns:
The names of the fields that objects of this type support.

getFieldInitialValue

public java.lang.String getFieldInitialValue(java.lang.String fieldName)
Description copied from interface: IDataType
Returns the initial value for new instances of the specified field.

Specified by:
getFieldInitialValue in interface IDataType
Parameters:
fieldName - The name of the field to determine the initial value of.
Returns:
The initial value for new instances of the specified field.

getFieldType

public IDataType getFieldType(java.lang.String fieldName)
Description copied from interface: IDataType
Returns the type of the specified field or null if no such field exists.

Specified by:
getFieldType in interface IDataType
Parameters:
fieldName - The name of the field to determine the type of.
Returns:
The type of the specified field or null if no such field exists.

isSimpleType

public boolean isSimpleType()
Description copied from interface: IDataType
Returns true if this type represents a boolean, date, decimal, number, or string type.

Specified by:
isSimpleType in interface IDataType
Returns:
True if this type represents a boolean, date, decimal, number, or string type.

isArrayType

public boolean isArrayType()
Description copied from interface: IDataType
Returns true if this type represents an array type.

Specified by:
isArrayType in interface IDataType
Returns:
True if this type represents an array type.

isComplexType

public boolean isComplexType()
Description copied from interface: IDataType
Returns true if this type represents a type with named fields.

Specified by:
isComplexType in interface IDataType
Returns:
True if this type represents a type with named fields.